home *** CD-ROM | disk | FTP | other *** search
/ What PC? 1997 February / WPCFEB97.ISO / multi / times / data / article.dir / 00020_oldPrint script.txt < prev    next >
Encoding:
Text File  |  1996-08-12  |  1.8 KB  |  58 lines

  1. on mouseUp
  2.   
  3.   --initialize xobject
  4.   if objectP(myPrinter) then myPrinter(mDispose)
  5.   put print_x(mNew) into myPrinter
  6.   
  7.   --styles
  8.   myPrinter(mSetHeaderStyle1, "Times", 14, 1) -- font style for header 1
  9.   myPrinter(mSetHeaderStyle2, "Times", 10, 0) -- font style for header 2
  10.   myPrinter(mSetBodyStyle, "Times", 10, 0) -- font style for main body text
  11.   
  12.   myPrinter(mSetJustify1, 1) -- left justify header 1
  13.   myPrinter(mSetJustify2, 1) -- left justify header 2
  14.   myPrinter(mSetBodyJustify, 1) -- left justify the body text
  15.   myPrinter(mSetBodyTop, 70) -- set the upper start point for body
  16.   
  17.   
  18.   --create local variable with body text & Copyright info
  19.   put "This is copyright info" into theCopyright                                
  20.   
  21.   put the text of field "artText" & return & return & theCopyright into thetext
  22.   
  23.   put 30 into maxDocumentLength
  24.   put 1 into pageNumber
  25.   
  26.   repeat while the number of lines of thetext >= maxDocumentLength
  27.     
  28.     put line 1 to maxDocumentLength of thetext into textToPrint
  29.     
  30.     -- put "Printing page #"&pagenumber -- DEBUG
  31.     
  32.     put myPrinter(mPrintPage, the text of cast "artHead", the text of cast "artHead2", ┬¼
  33. textToPrint, "", 0) into printerResult
  34.     
  35.     if printerResult <> "OK" then
  36.       alert "There was a printer error.  Code:"&&printerResult
  37.     end if
  38.     
  39.     delete line 1 to maxDocumentLength of theText
  40.     put pageNumber + 1 into pageNumber
  41.   end repeat
  42.   
  43.   -- print the final page
  44.   put thetext into textToPrint
  45.   
  46.   -- put "Printing page #"&pagenumber -- DEBUG
  47.   put myPrinter(mPrintPage, the text of cast "artHead", the text of cast "artHead2", ┬¼
  48. textToPrint, "", 0) into printerResult
  49.   
  50.   if printerResult <> "OK" then
  51.     alert "There was a printer error.  Code:"&&printerResult
  52.   end if
  53.   
  54.   -- printing is done
  55.   myPrinter(mDispose)
  56.   
  57. end
  58.